import request from "@/utils/request";

// 查询【请填写功能名称】列表
export function listInfo(query) {
  return request({
    url: "/contract/info/list",
    method: "get",
    params: query,
  });
}

export function allList(query) {
  return request({
    url: "/contract/info/listAll",
    method: "get",
    params: query,
  });
}

export function listGroupSalary(query) {
  return request({
    url: "/contract/info/listGroupSalary",
    method: "get",
    params: query,
  });
}

export function listSalary(query) {
  return request({
    url: "/contract/info/listSalary",
    method: "get",
    params: query,
  });
}

export function listForDue(query) {
  return request({
    url: "/custom/info/listForDue",
    method: "get",
    params: query,
  });
}

// 查询【请填写功能名称】详细
export function getInfo(id) {
  return request({
    url: "/contract/info/" + id,
    method: "get",
  });
}

// 新增【请填写功能名称】
export function addInfo(data) {
  return request({
    url: "/contract/info",
    method: "post",
    data: data,
  });
}

// 修改【请填写功能名称】
export function updateInfo(data) {
  return request({
    url: "/contract/info",
    method: "put",
    data: data,
  });
}

// 删除【请填写功能名称】
export function delInfo(id) {
  return request({
    url: "/contract/info/" + id,
    method: "delete",
  });
}

// 删除临时pdf文件
export function delTempPDF(data) {
  return request({
    url: `/contract/info/deletePreview/?pdf=${data}`,
    method: "get",
  });
}
//查看pdf
export function openPDF(filename) {
  return request({
    url: "/contract/info/pdf/" + filename,
    method: "get",
    responseType: "blob",
  });
}

//load
export function loadImage(data) {
  return request({
    url: "/custom/info/loadImageOfAddress",
    method: "post",
    data: data,
    responseType: "blob",
  });
}
// 申请盖章
export function askStamp(data) {
  return request({
    url: "/system/seal",
    method: "post",
    data: data,
  });
}
// 查看服务项目
export function serviceItems(id) {
  return request({
    url: `/contract/info/item/${id}`,
    method: "get",
  });
}
// 获取合同服务项目
export function contractItem(id) {
  return request({
    url: `/contract/info/contractItem/${id}`,
    method: "get",
  });
}
// 获取统计数据
export function contractCount(data) {
  return request({
    url: "/contract/info/contractCount",
    method: "post",
    data: data,
  });
}
// 获取派单内容
export function taskInfo(id) {
  return request({
    url: `/system/taskInfo/${id}`,
    method: "get",
  });
}
// 业务描述提交修改
export function updateTask(data) {
  return request({
    url: "/system/taskInfo",
    method: "put",
    data: data,
  });
}
